package com.ourfox.commons.datasource;

import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;

/**
 * 
 * <p>Title: DynamicDataSource.java</p>
 * <p>Description: 动态路由数据源</p>
 * <p>Company: ourfox</p>
 *
 * @author luoxiujin<xiujin.luo@gmail.com>  
 * @version V1.0
 * @date 2011-10-13 下午8:38:06
 *
 */
public class DynamicDataSource extends AbstractRoutingDataSource {
	
	@Override
	protected Object determineCurrentLookupKey() {
		// 在进行DAO操作前，通过上下文环境变量，获得数据源的类型
		return DataSourceContextHolder.getDataSourceType();
	}
}
